﻿<div [@routerTransition]>
    <h1>用户管理</h1>
    <div class="row">
        <div class="col-md-12">
            <button data-toggle="modal" class="btn btn-primary pull-right btn-sm" (click)="createUser()"><i class="fa fa-plus"></i> 添加用户</button>
            <table class="table table-striped table-bordered table-hover table-condensed">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>手机号</th>
                        <th>姓名</th>
                        <th>最后登录时间</th>
                        <th>是否有效</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr *ngFor="let user of users">
                        <td>{{user.id}}</td>
                        <td>{{user.phoneNumber}}</td>
                        <td>{{user.name}}</td>
                        <td>{{user.lastLoginTime|date:'yyyy-MM-dd HH:mm:ss'}}</td>
                        <td>{{user.isActive ? l('Yes') : l('No')}}</td>
                        <td><a class="btn btn-primary btn-sm" role="button" (click)="deleteUser(user.id)">删除</a></td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<createUserModal #createUserModal (modalSave)="getUsers()"></createUserModal>